import { defHttp } from '/@/utils/http/axios';
import { IPostMenusAddRequest } from '/@/types/system/senior/menus/add';
import { IPostMenusUpdateRaw } from '/@/types/system/senior/menus/update';
import {
  IPostMenusQueryRequest,
  IPostMenusQueryResponse,
} from '/@/types/system/senior/menus/query';
import { IGetMenusDropdownResponse } from '/@/types/system/senior/menus/dropdown';
import { IGetRawMenusDetailsResponse } from '/@/types/system/senior/menus/details';

/**
 * 删除菜单
 */
export const apiDeleteMenusDeletePath = (menuId: string | number) =>
  defHttp.delete({ url: `/system/senior/menus/delete/${menuId}` });
/**
 * 添加菜单
 */
export const apiPostMenusAdd = (params: IPostMenusAddRequest) =>
  defHttp.post({ url: `/system/senior/menus/add`, params });
/**
 * 编辑菜单
 */
export const apiPostMenusUpdatePath = (menuId: string | number, params: IPostMenusUpdateRaw) =>
  defHttp.post({ url: `/system/senior/menus/update/${menuId}`, params });
/**
 * 菜单列表
 */
export const apiPostMenusQuery = (params: IPostMenusQueryRequest) =>
  defHttp.post<IPostMenusQueryResponse>({ url: `/system/senior/menus/query`, params });
/**
 * 菜单列表（树级）
 */
export const apiGetMenusDropdown = () =>
  defHttp.get<IGetMenusDropdownResponse>({ url: `/system/senior/menus/dropdown` });
/**
 * 菜单详情
 */
export const apiGetMenusDetailsPath = (menuId: string | number) =>
  defHttp.get<IGetRawMenusDetailsResponse>({ url: `/system/senior/menus/details/${menuId}` });
